package redis

import (
	"fmt"
	"github.com/go-redis/redis"
	"product666/appconfig"
)

var (
	Client *redis.Client
)

func RedisInit() {
	var appConf = appconfig.Conf.RedisConfig
	Client = redis.NewClient(&redis.Options{
		Addr:     appConf.Addr,
		Password: appConf.Password,
		DB:       appConf.DB,
	})
	Ping, err := Client.Ping().Result()
	fmt.Println(Ping, err)
	if err != nil {
		fmt.Println("redis连接失败")
	} else {
		fmt.Println("redis连接成功")
	}
}
